home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 February / EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso / earcd / util1 / yk211src.lha / Yak_2.11_Src / GetPubScreen.c < prev    next >
C/C++ Source or Header  |  1995-10-18  |  1KB  |  51 lines

  1.  
  2.  
  3. #include <exec/types.h>
  4. #include <intuition/screens.h>
  5. #include <proto/intuition.h>
  6.  
  7. #include "GetPubScreen.h"
  8.  
  9. UBYTE
  10. *GetPubScreenName( struct Screen *s)
  11. {
  12.     struct List *list; /*NMC*/
  13.     struct PubScreenNode *psnode; 
  14.     UBYTE *PSName;
  15.  
  16.     PSName = NULL;
  17.     if (s->Flags & WBENCHSCREEN)
  18.     {
  19.         PSName = "Workbench";
  20.     }
  21.     else
  22.     {
  23.         if (s->Flags & PUBLICSCREEN)
  24.         {
  25.             /* s is a public screen so find its name */
  26.  
  27.             if (list = LockPubScreenList()) /*NMC*/
  28.             {
  29.                 psnode = (struct PubScreenNode *) list->lh_Head; /*NMC*/
  30.  
  31.                 while ((psnode->psn_Node.ln_Succ) && !(PSName)) /*NMC*/
  32.                 {
  33.                     if (!(psnode->psn_Flags & PSNF_PRIVATE) && (psnode->psn_Screen == s))  /*NMC*/
  34.                     {
  35.                         /* found it */
  36.                         PSName = psnode->psn_Node.ln_Name;
  37.                     }
  38.                     else
  39.                     {       
  40.                         /* check next one */
  41.                         psnode = (struct PubScreenNode *)psnode->psn_Node.ln_Succ;
  42.                     }
  43.                 }
  44.             }
  45.  
  46.             UnlockPubScreenList();                
  47.         }
  48.     }
  49.     return(PSName);
  50. }
  51.